package com.guigu.www.luolujin.Conteoller;

import com.guigu.www.luolujin.Service.LljRiskTestService;
import com.guigu.www.pojo.PageVo;
import com.guigu.www.pojo.RiskTest;
import com.guigu.www.pojo.Rubric;
import com.guigu.www.pojo.UserAnswer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 作者 罗露金
 */@RestController
@RequestMapping("/LljRiskTestServlet")
public class LljRiskTestServlet {
     @Autowired
     LljRiskTestService service;

     @GetMapping()
     public PageVo<RiskTest> PageRiskTest(Integer pageNum, Integer pageSize, String riskTestName){
        return  service.PageRiskTest(pageNum, pageSize, riskTestName);
    }
    @GetMapping("/selectRubric")
    public List<Rubric> selectRubric(Integer rubType){
         return service.selectRubric(rubType);
    }
    @PostMapping("/add")
    public void insertUserAnswer(@RequestBody List<UserAnswer> UserAnswer, String memId) {
        service.insertUserAnswer(memId,UserAnswer);
    }
    @PostMapping()
    public void insertRiskTest(String riskTestName, Integer memId){
         service.insertRiskTest(riskTestName, memId);
    }

}
